package cn.mhome.merchant.dao.spring.data.repository.entity;

public enum FieldType {
	Byte, Short, Integer, Float, Long, Date, String, Double, Boolean;

	static FieldType format(String type) {
		FieldType ft = null;
		switch (type) {
		case "byte":
		case "java.lang.Byte":
		case "short":
		case "java.lang.Short":
			ft = FieldType.Short;
			break;
		case "int":
		case "java.lang.Integer":
			ft = FieldType.Integer;
			break;
		case "boolean":
		case "java.lang.Boolean":
			ft = FieldType.Boolean;
			break;
		case "float":
		case "java.lang.Float":
			ft = FieldType.Float;
			break;
		case "double":
		case "java.lang.Double":
			ft = FieldType.Double;
			break;
		case "String":
		case "java.lang.String":
			ft = FieldType.String;
			break;
		case "long":
		case "java.lang.Long":
			ft = FieldType.Long;
			break;
		case "Date":
		case "java.util.Date":
			ft = FieldType.Date;
			break;
		default:
			break;
		}
		return ft;
	}
}
